package com.sy.server.timing;

import com.sy.server.service.IFeedbackService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.stereotype.Component;

@Component
@EnableScheduling
public class TimingTask {

    @Autowired
    private IFeedbackService feedbackService;

    private Logger logger= LoggerFactory.getLogger(SchedulingConfigurer.class);

    @Scheduled(cron = "0 0 12 ? * SUN")
    public void timingTask(){
        logger.info("定时任务开始执行");
        feedbackService.syncLikes();
        logger.info("定时任务执行完毕");
    }
}
